import pygame
import random
pygame.init()
class BlackHole(pygame.sprite.Sprite):
    def __init__(self,width,height):
        pygame.sprite.Sprite.__init__(self)
        
        self.width,self.height=width,height
        self.image=pygame.image.load('images/black_hole.png').convert_alpha()
        self.image2=pygame.transform.rotate(pygame.image.load('images/black_hole.png').convert_alpha(),30)
        self.image3=pygame.transform.rotate(pygame.image.load('images/black_hole.png').convert_alpha(),60)
        self.image4=pygame.transform.rotate(pygame.image.load('images/black_hole.png').convert_alpha(),90)
        self.image5=pygame.transform.rotate(pygame.image.load('images/black_hole.png').convert_alpha(),120)
        self.image6=pygame.transform.rotate(pygame.image.load('images/black_hole.png').convert_alpha(),150)
        self.rect=self.image.get_rect()
        self.rect.left,self.rect.top=width,height
        self.mask=pygame.mask.from_surface(self.image)
        self.time=0
        self.alive=False
        self.code=False

    def arise(self):
        self.rect.left,self.rect.top=random.randint(0,self.width-self.rect.width),random.randint(0,self.height-self.rect.height)
        self.time=pygame.time.get_ticks()
        
    def reset(self):
        self.rect.left,self.rect.top=self.width,self.height
